package com.oa.ylms.apps.actions.plan;

import java.util.List;

import com.oa.ylms.apps.actions.BasicAction;
import com.oa.ylms.apps.business.organization.IPostInfoService;
import com.oa.ylms.apps.business.organization.ISectionInfoService;
import com.oa.ylms.apps.business.plan.ICheckPlanCategoryService;
import com.oa.ylms.apps.business.plan.ICheckPlanService;
import com.oa.ylms.apps.constants.IDEDStates;
import com.oa.ylms.apps.entity.organization.PostInfoValue;
import com.oa.ylms.apps.entity.organization.SectionInfoValue;
import com.oa.ylms.apps.entity.plan.CheckPlanCategoryValue;
import com.oa.ylms.apps.entity.plan.CheckPlanValue;

@SuppressWarnings("serial")
public class CheckPlanAction extends BasicAction {
	private List<SectionInfoValue> sectionList;
	private List<PostInfoValue> postList;
	private List<CheckPlanCategoryValue> categoryList;
	private List<CheckPlanValue> planList;
 	private ISectionInfoService sectionService;
	private IPostInfoService postService;
	private ICheckPlanCategoryService categoryService;
	private ICheckPlanService planService;
	
	private Integer sectionId;
	private Integer postId;
	private String planOrders;
	private Integer sectionListSize;
	private Integer categoryId;
	private Integer planId;

	@Override
	public String execute() throws Exception {
		planService.addCheckPlan(categoryId, postId, planOrders);
		return SUCCESS;
	}
	
	public String load() throws Exception{
		sectionList = sectionService.querySectionInfo(null, IDEDStates.ENABLE);
		//query post by sectionId
		//postList = postService.queryPostInfoBySectionId(1);
		//query enable category
		categoryList = categoryService.queryCheckPlanCategory(IDEDStates.ENABLE);
		planList=planService.queryCheckPlanWithPage(null, null, rows, currpage);
		totalpage=planService.countTPage(null, null, rows);
		count=planService.getTotalNumber();
		sectionListSize = sectionList.size();
		return "show";
	}
public String delete()throws Exception{
	planService.deleteCheckPlan(planId);
	return "delete";
}
	
	
	public Integer getSectionId() {
		return sectionId;
	}

	public void setSectionId(Integer sectionId) {
		this.sectionId = sectionId;
	}

	public Integer getSectionListSize() {
		return sectionListSize;
	}

	public void setSectionListSize(Integer sectionListSize) {
		this.sectionListSize = sectionListSize;
	}

	public List<SectionInfoValue> getSectionList() {
		return sectionList;
	}

	public void setSectionList(List<SectionInfoValue> sectionList) {
		this.sectionList = sectionList;
	}

	public List<PostInfoValue> getPostList() {
		return postList;
	}

	public void setPostList(List<PostInfoValue> postList) {
		this.postList = postList;
	}

	public Integer getPlanId() {
		return planId;
	}

	public void setPlanId(Integer planId) {
		this.planId = planId;
	}

	public List<CheckPlanCategoryValue> getCategoryList() {
		return categoryList;
	}

	public void setCategoryList(List<CheckPlanCategoryValue> categoryList) {
		this.categoryList = categoryList;
	}

	public List<CheckPlanValue> getPlanList() {
		return planList;
	}

	public void setPlanList(List<CheckPlanValue> planList) {
		this.planList = planList;
	}

	public ISectionInfoService getSectionService() {
		return sectionService;
	}

	public void setSectionService(ISectionInfoService sectionService) {
		this.sectionService = sectionService;
	}

	public IPostInfoService getPostService() {
		return postService;
	}

	public void setPostService(IPostInfoService postService) {
		this.postService = postService;
	}

	public ICheckPlanCategoryService getCategoryService() {
		return categoryService;
	}

	public void setCategoryService(ICheckPlanCategoryService categoryService) {
		this.categoryService = categoryService;
	}

	public ICheckPlanService getPlanService() {
		return planService;
	}

	public void setPlanService(ICheckPlanService planService) {
		this.planService = planService;
	}

	public String getPlanOrders() {
		return planOrders;
	}

	public void setPlanOrders(String planOrders) {
		this.planOrders = planOrders;
	}

	public Integer getPostId() {
		return postId;
	}

	public void setPostId(Integer postId) {
		this.postId = postId;
	}

	public Integer getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}
	
	
}
